*SM-F2

version 17
	
use ../Metadata/tess_analysisdata.dta, clear




	lab var successfulexp_insample "Significant Results"

	lab var medtime15 "Median time"	
	lab var samplesize "Sample size"
	lab var year "Year study fielded"
	lab var total_hyp "No. of hypotheses"
	
	lab var completionrate "CompletionRate"
	destring completionrate, replace
	
	lab var type_conj_dce "Conjoint/DCE"
	lab var type_information "Info. prov. exp."
	lab var type_beliefelicit "Belief elicit. exp."
	lab var type_questwording "Quest. wording exp."
	lab var clarity "Clarity"


	recode title (1 2 6=0) (3/5=1), gen(faculty)
		tab faculty
		lab var faculty "Faculty PI"

	tab discipline_collapse, gen(field_)
		gen polsci=field_1
		lab var polsci "Political science"

		
	recode numauthors (1=0) (2/10=1), gen(authors2)
		lab var authors2 "Co-authored"	
	
* whether study had any of these type of hypotheses
	egen mediationany= max(mediation), by(vendor_id)
	lab var mediationany "Any Mediation test"
	
	egen moderationany= max(moderation), by(vendor_id)
	lab var moderationany "Any Moderation test"	
	
	
keep if hyp_num==1	
********************************************************************************
corr ///
	successfulexp_insample ///
	samplesize total_hyp completionrate ///	
	woman faculty polsci authors2 /// PI attributes
	medtime15 shortstudy /// length
	type_beliefelicit type_conj_dce type_framing type_information type_priming type_questwording type_vignette type_writing /// experiment type
	pilot any_checks clarity ///
	mediationany ///
	moderationany 

matrix corrmatrix = r(C)




heatplot corrmatrix, ///
label ///
xlabel(, angle(vertical) labsize(1.7) nogrid) ///
ylabel(, labsize(1.7) nogrid) ///
title("{bf: Correlation Heatplot, study-level}" ///
, size(2.2) span) ///
graphregion(color(white) margin(l=-4)) ///
aspectratio(1) ///
colors(blue midblue eltblue ///
eggshell ///
gold dkorange red ///
, intensity(.9) reverse) ///
cuts(-1 -.75 -.25 -.05 .05 .25 .75 1) drop(0) ///
lower /// display lower triangle only
legend(order (1 "-1 to -.75" 2 "-.75 to -.25" 3 "-.25 to -.05" 4 "-.05 to .05" 5 ".05 to .25" 6 " .25 to .75" 7 ".75 to 1") subtitle(" ") region(lwidth(none)) ) ///
note("Note: N (studies)= 100.", size(1.7) span) ///
xsize(6.5) ysize(5.5) 


graph export "../Results/SM-F2-Figure-CorrHeatPlot_study.pdf", replace
